package com.example.ndkjnidemo.home.arraylist

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import com.blankj.utilcode.util.LogUtils
import com.example.ndkjnidemo.R

class ArraylistActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_arraylist)

        var arrayList = MyArrayList()
        for(i in 0 until 20){
            arrayList.add(i)
        }
        LogUtils.i("移除前的大小","${arrayList.size()}")
        //移除掉一个值
        arrayList.remove(10)
        LogUtils.i("移除后的大小","${arrayList.size()}")
        for (i in 0 until arrayList.size()){
            val element = arrayList.get(i)
            LogUtils.i("获取的值","$element")
        }
    }
}
